package org.example.events.hostable.sales;

import org.example.models.abstracts.AbstractItem;
import org.example.models.interfaces.Action;
import org.example.person.Person;

import java.util.Map;

//Set of actions for sales event participant
//TODO: change functions to return concrete class implementing action not lambda.
public class ClientSalesActions {
    public static Action<Person> joinSales(SalesEvent salesEvent, Map<Class<? extends AbstractItem>, Integer> request) {
        return person -> {
            if(!salesEvent.isStarted()) return;
            salesEvent.addClient(new SalesEvent.Client(person, request));
        };
    }
}
